package com.yinshu.teleshield.utils;

import cn.hutool.core.date.DateUtil;

public class CodeGenerateUtils {
    /**
     * 任务生成唯一的SolverCode
     *
     * @return
     */
    public static synchronized String generateSolverCode() {
        return "S_" + DateUtil.format(DateUtil.date(), "yyMMddHHmmssss");
    }

    /**
     * 场景分类生成唯一的Code
     *
     * @return
     */
    public static synchronized String generateScenarioCategoryCode() {
        return "sce_cate_" + DateUtil.format(DateUtil.date(), "yyMMddHHmmssss");
    }

    /**
     * 场景生成唯一的Code
     *
     * @return
     */
    public static synchronized String generateScenarioCode() {
        return "sce_" + DateUtil.format(DateUtil.date(), "yyMMddHHmmssss");
    }

    /**
     * 计划参数编码生成唯一的Code
     *
     * @return
     */
    public static synchronized String generatePlanParameterCode() {
        return "pp_" + DateUtil.format(DateUtil.date(), "yyMMddHHmmssss");
    }

    public static void main(String[] args) {
        System.out.println(generateSolverCode());
        System.out.println(generateScenarioCode());
        System.out.println(generateScenarioCategoryCode());
    }

}
